package com.example.mydemo2;

import android.os.Parcel;
import android.os.Parcelable;

public class User implements Parcelable {
    private String username;
    private String pwd;
    private String phone;
    private String gender;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public static Creator<User> getCREATOR() {
        return CREATOR;
    }

    public User() {
    }

    public User(String username, String pwd, String phone, String gender) {
        this.username = username;
        this.pwd = pwd;
        this.phone = phone;
        this.gender = gender;
    }

    protected User(Parcel in) {
        username = in.readString();
        pwd = in.readString();
        phone = in.readString();
        gender = in.readString();
    }

    public static final Creator<User> CREATOR = new Creator<User>() {
        @Override
        public User createFromParcel(Parcel in) {
            return new User(in);
        }

        @Override
        public User[] newArray(int size) {
            return new User[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(username);
        parcel.writeString(pwd);
        parcel.writeString(phone);
        parcel.writeString(gender);
    }
}
